const useDocumentVisibility = (type = 'add', fn) => {
    // 监听/移除页面可见
    document[`${type}EventListener`]('visibilitychange', fn);
};

export { useDocumentVisibility };
